Generally, protecting the entire code execution is too expensive and, in current implementations, the security configuration is fixed by default and it is dependent of the sensitivity of the process executed.
That means, sensitive code like cryptographic operations are well protected but other part of the code are more vulnerable.
If the entire code needs to be protected, the countermeasures will be enabled all the time and the performances will be decreased accordingly.
Increasing countermeasures level in case an attack is detected is also known. It may consist in temporarily freezing the execution of the code or any other known countermeasures. However, such method does not enable any adaptation of the countermeasures.